package com.wy.about_attributes.demo1;

/**
 * @author 美女
 * @date 2022/04/20 10:04
 **/
public class Main4 {
    private static class MyThread extends Thread{
        @Override
        public void run() {
            System.out.println("......");
        }
    }
    public static void main(String[] args) {
        Thread t=Thread.currentThread();//获取当前线程
        Thread.State state=t.getState();//获取到当前线程状态
        System.out.println(state);//结果打印：RUNNABLE-正在运行状态

        MyThread t1=new MyThread();
        System.out.println(t1.getState());//还没有start()启动线程，NEW状态
        t1.start();
        System.out.println(t1.getState());//RUNNABLE
    }
}
